<#include "/WEB-INF/common/header.ftl"/>
<script type="text/javascript">
	var pathToImages = '${brandingStaticLocation?default("")}/default/classic/image/calendar/';
	var showCheckbox = false;
	
	
	function save() {
		clearAllInputItem();
		if (saveCheck()) {
			$("thisForm").submit();
		}
	}
	
	function saveCheck() {
		if ($F("name") == "") {
			addInputErrorMessage($("name"), "请填写用户组名称！");
			return false;
		} else {
			clearInputState($("name"));
		}
		
		return true;
	}
</script>
<@taskMacro.showBrandingStyle "dhtmlgoodies_calendar.css"/>
<@taskMacro.showBrandingJs "dhtmlgoodies_calendar.js"/>
<@taskMacro.showBrandingJs "tipsutil.js"/>
<script type="text/javascript" src="${base}/static/js/fileutil.js"></script>
<div class="Main">
  <div class="Main_fix">
    <#include "/WEB-INF/common/side.ftl"/>
    <div class="Main_body" id="Main_body">
      <div class="Main_locationBar">
        <div class="Main_locationBar_head"></div>
        
        <div class="Main_locationBar_body"><span id="CurrentPosition">任务管理 -> 新增</span>
		</div>
        <div class="Main_locationBar_foot"></div>
      </div>
      <div class="Main_bodyEditBar">
		<div class="Main_bodyEditBar_head"><span>新用户组</span></div>
		<@opMacro.showActionResultMsg isSuccess=opResult/>
        <div class="Main_bodyEditBar_body">
          <form id="thisForm" method="post" action="${base}/usergroup/save.action?menuname=${menuname?if_exists}"> 
          <table width="100%" border="0" cellpadding="0" cellspacing="1" class="editTable">
            <tbody>
              <tr>
                <td class="title">组名<em>*</em></td>
                <td class="content2">
                	<input type="text" class="input" name="userGroup.name" id="name" value="${(userGroup.name)?if_exists}"/>
                </td>
			  </tr>
			  
			  <tr>
                <td class="title">组长<em>*</em></td>
                <td class="content2">
                	<select name="userGroup.leader.id" id="leader">
						<#list userList as user>
							<option value="${user.id}">${user.name}</option>
						</#list>
                	</select>
                </td>
			  </tr>
			  <tr>
			  	<td class="title">组员<em>*</em></td>
                <td class="content2">
                	<#list userList as user>
                		<span><input type="checkbox" value="${user.id}" name="userIds">&nbsp;${user.name}</span>
                	</#list>
                	
                </td>
			  </tr>
			  
            </tbody>
          </table>
          </form>
		</div>
        <div class="Main_bodyEditBar_foot"></div>
      </div>
      <div class="Main_buttonGroupBar">
        <div class="Main_buttonGroupBar_head"></div>
        
        <div class="Main_buttonGroupBar_body">
          <input type="button" class="button" value="保存" onclick="save();"/> 
          <input type="button" class="button" value="返回" onclick="location.href='${base}/usergroup/grouplist.action?menuname=${menuname?if_exists}&sessionFlag=true'"/>
        </div>
        
        <div class="Main_buttonGroupBar_foot"></div>
      </div>
    </div>
  </div>
</div>
<#include "/WEB-INF/common/footer.ftl"/>
<#--
<#include "/template/default/common/common-js.ftl"/>
<#include "/template/default/common/js.ftl"/> -->
